<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<input type="text" name="" id="one" value="" />
		<select name="">
			<option value="" id="FH">+</option>
			<option value="" id="FH">-</option>
			<option value="" id="FH">*</option>
			<option value="" id="FH">/</option>
		</select>
		<input type="text" id='two'>
		<button type="button" onclick="Cilck1()">计算</button>
		<input type="text" id="JG" value="" name="4" />
	</body>
	<script type="text/javascript">
	function Cilck1(){
		 var no1=parseFloat(document.getElementById('one').value);
		 console.log('第一个值'+no1);
		 var no2=parseFloat(document.getElementById('two').value);
		 console.log('第二个值'+no2);
		 var result=0;
		 var FH=document.getElementById('FH'); //定位查询的下拉框id
		 console.log(FH);
		 var index=FH.selectedIndex;  //定位选中的索引
		 console.log(index);
		 if(index==0){
		 	result=no1+no2;
		 }else if(index==1){
		 	result=no1-no2;
		 }else if(index==2){
		 	result=no1*no2;
		 }else if(index==3){
		 	result=no1/no2;
		 console.log(result);
		 document.getElementById('JG').value=result;
	}
	
		
	</script>
</html>
